package com.dingwen.treasure.business.controller;

import com.dingwen.treasure.base.controller.BaseViewController;
import com.dingwen.treasure.base.pojo.vo.Result;
import com.dingwen.treasure.business.model.dto.TaskGenerateDto;
import com.dingwen.treasure.business.service.TaskGenerateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 　TaskGenerateController
 * 　@author dingwen
 * 　@date 2022/8/4
 */
@Api(tags = "责任链模式案例：任务生成")
@RestController
@Slf4j
@RequestMapping("task/generate")
public class TaskGenerateController implements BaseViewController {

    @Resource
    private TaskGenerateService taskGenerateService;

    @ApiOperation(value = "测试", response = Result.class)
    @ApiImplicitParam(name = "taskGenerateDto", value = "taskGenerateDto", paramType = "body")
    @PostMapping()
    public void test(@RequestBody TaskGenerateDto taskGenerateDto) {
        taskGenerateService.generate(taskGenerateDto);
    }
}
